﻿FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
WORKDIR /app

COPY *.csproj ./
RUN dotnet restore


COPY . ./
RUN dotnet publish -c Release -o out


FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS runtime
WORKDIR /app
COPY --from=build /app/out ./


ENV ConnectionStrings__DefaultConnection "Host=localhost;Port=5432;Database=weatherDB;Username=postgres;Password=123"


EXPOSE 5432
ENTRYPOINT ["dotnet", "WeatherAPI.dll"]
